1, example 11.1, Yaml file contents are as follows:host: localhost:3306user: rootpwd: 123456dbname: test 1.2, the code is as follows: //Convert the Yaml file to an object and convert it to JSON format to output the package Mainimport
Recently processed some configuration files, encountered in the YAML format of the file, because no previous contact with this format file, for XML is more familiar. So what is YAML? What are the advantages and disadvantages of it compared to XML?
Yaml is an easy to read, suitable for Presentation program language data structure, can be used to exchange data between different programs, support generic tools, support serial processing, rich expression capabilities and scalability, Easy-to-use
Basic rules
YAML has the following basic rules:
1, Case sensitive
2. Use indentation to represent hierarchical relationships
3, prohibit the use of tab indentation, you can only use the space key
4. There is no limit to the indentation length, as
Serialization in. NET is usually in binary or xml format. After ajax emerged, the JSON format is also used, which is rare compared with YAML.
BinaryCannot be directly read. It must be decoded at the binary level;The format is defined by the vendor.
Good articles must be transferred: http://www.cnblogs.com/chwkai/archive/2005/10/07/beginning_yaml.html
Yaml is also a thing. In the case of XML flooding, the appearance of Yaml is really a bright, in the initial study of Yaml after a rough summary
As Yaml represents, Yaml Ain ' t Markup Language,yaml is a concise, non-markup language. YAML is data-centric, uses whitespace, indents, and organizes data into branches, making the presentation more concise and readable.
While learning the rules,
YAML Introduction
YAML is a format used to express resource sequences, and is highly readable because of the reference to other multilingual languages. YAML is the abbreviation for Yaml Ain ' t a Markup language, which is that YAML is not
/*** Copyright (c),http://www.snakeyaml.org* * Licensed under the Apache License, Version 2.0 (the "License"); * you are not a use this file except in compliance With the License. * Obtain a copy of the License at *
Playbook is a list of one or more "play"The main function of play is to dress up a pre-set host as a role defined in advance through the task in ansible. Fundamentally, the so-called task is nothing more than a call to Ansible's module. By
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.